//2009/08/14 02:19:55
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class grafixCorrupt
{
public:
    int selectWord(vector <string> dictionary, string candidate)
    {
        int dex = -1;
		int gap = 0;
        for (int i=0; i<dictionary.size(); i++)
        {
			int ngap = 0;
			for(int j=0; j<candidate.size(); j++)
			{
				if(candidate[j] == dictionary[i][j])
					ngap++;
			}
			if(ngap > gap) 
			{
				gap = ngap;
				dex = i;
			}
        }
		return dex;
    }
};
